#include "Classes.h"

void Character::Animate() {
	ImageRect = (Zelda->Device->getTimer()->getTime()/AnimationInterval % 2) ? ImageRect1 : ImageRect2;
}
void Character::AddItem(Item* pItem) {
	Items.push_back(pItem);
}
eDirection Character::GetDirection() {
	return Direction;
}
void Character::UseItem(bool ChangeImageRects) {
	UseItemStartTime = Zelda->Device->getTimer()->getTime();
	Action = ActionUseItem;
	if(ChangeImageRects == true) SetImageRects();
}
eAction Character::GetAction() {
	return Action;
}
void Character::ResetAction() {
	if(Action == ActionUseItem && Zelda->Device->getTimer()->getTime() - UseItemStartTime > ActionResetInterval) {
		Action = ActionReset;
		SetImageRects();
	}
}